package org.blade.personal.framework.session.concre.StandardDslSession;

import org.blade.personal.framework.dsl.sql.Sql;
import org.blade.personal.framework.jdbc.StatementSetter;
import org.blade.personal.framework.jdbc.datasource.DataSource;
import org.blade.personal.framework.jdbc.stmt.SimpleStatementSetter;
import org.blade.personal.framework.orm.EntityAlias;
import org.blade.personal.framework.session.AbstractDslSession;
import org.blade.personal.framework.session.DslSession;
import org.blade.personal.framework.session.Executer;
import org.blade.personal.framework.session.executer.ExecuterFacade;

/**
 * 标准DslSession
 * 
 * @author ZGF
 * @version 0.1
 */
public class StandardDslSession extends AbstractDslSession implements
		DslSession {

	
	/**
	 * StandardDslSession Constructcor
	 * @param ds
	 */
	public StandardDslSession(DataSource ds) {
		this.ds = ds;
		this.connection = ds.getConnection();
	}

	@Override
	public Executer create(Sql sql) {

		StatementSetter statementSetter = new SimpleStatementSetter(connection);
		Executer executer = new ExecuterFacade(statementSetter, sql);
		return executer;
	}

	@Override
	public int executeUpdate(Sql sql) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int add(EntityAlias entity) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(EntityAlias entity) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(EntityAlias entity) {
		// TODO Auto-generated method stub
		return 0;
	}

}
